<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" />
    <title>押品搜索</title>
    <style>
    .table>tbody>tr>td{
        vertical-align: middle;
    }
    </style>
</head>

<body class="fixed-navbar fixed-sidebar">
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li class="active">
                        <span>还款搜索</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                还款搜索
            </h2>
        </div>
    </div>
</div>
<div class="content animate-panel">
    <div class="row">
        <g:form method="POST" controller="repaymentImport" action="searchImport"    class="form-horizontal" role="form">
            <input type="hidden" id="id" name="id" value="${params?.id}">
        <div class="hpanel hblue">
            <div class="panel-heading">
                 <div class="panel-tools">
                    <button class="btn btn-primary btn-xs" type="submit"><i class="fa fa-search"></i>查询</button>
                    <button class="btn btn-warning2 btn-xs" type="button" id="resetBtn">
                        <i class="fa fa-times"></i>重置</button>
                </div>
                查询
            </div>
                <div class="panel-body seach-group">
                 <div class="form-group col-md-4">
                        <label for="serialNumber" class="col-sm-3 control-label">贷款编号</label>
                        <div class="col-sm-9">
                            <input type="text" class="form-control"  id="serialNumber" name="serialNumber" value="${params?.serialNumber}">
                        </div>
                    </div>
            <div class="form-group col-md-4">
                <label class="col-md-3 control-label">还款类型</label>
                <div class="col-md-9">
                    <g:select  class="form-control m-b"  name="repaymentType" from="${com.cindata.dictionary.RepaymentTypeDict.list()}" id="repaymentType"  optionKey="id"
                              optionValue="name"   value="${params?.repaymentType}" noSelection="${['':'请选择']}"></g:select>
                </div>
                </div>
            </g:form>
        </div>


    </div>
    <div class="row">
        <div class="hpanel hgreen">
            <div class="panel-heading">
                全部还款
            </div>
            <div class="panel-body ">
                <div class="table-responsive">
                    <table cellpadding="1" cellspacing="1" class=" table table-striped table-hover">
                        <thead>
                        <tr>
                            <g:sortableColumn property="serialNumber" title="贷款编号"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="repaymentDate" title="还款年月"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="repaymentType.name" title="还款类型"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="shouldRepaymentAmount" title="应还款金额（元）"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="shouldRepaymentCapital" title="应还款本金（元）"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="shouldRepaymentInterest" title="应还款利息（元）"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="practicalChargeBackDate" title="实际扣款日期"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="practicalRepaymentAmount" title="实际还款金额（元）"  class="col-md-1 text-center"params="${params}"/>
                            <g:sortableColumn property="practicalRepaymentCapital" title="实际还款本金（元）"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="practicalRepaymentInterest" title="实际还款利息（不含罚息）（元）"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="practicalRepaymentFine" title="实际还罚息（元）"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="overdueDate" title="逾期年月"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="overdueState.name" title="逾期状态"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="continuousOverdueNumber" title="连续逾期期数"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="fineAmount" title="罚息金额（元）"  class="col-md-1 text-center"/>
                            <g:sortableColumn property="prepaymentType.name" title="提前还款类型"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="beforePrepaymentDuration" title="提前还款缩期前期数（月）"  class="col-md-1 text-center" params="${params}"/>
                            <g:sortableColumn property="afterPrepaymentDuration" title="提前还款缩期后期数（月）"  class="col-md-1 text-center" params="${params}"/>
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${repaymentImportList}">
                            <tr class="text-center">
                                <td >${it?.serialNumber}</td>
                                <td>
                                    <g:formatDate date="${it?.repaymentDate}"
                                                  format="yyyy-MM"></g:formatDate>
                                </td>
                                <td>${it?.repaymentType?.name}</td>
                                <td>${it?.shouldRepaymentAmount}</td>
                                <td>${it?.shouldRepaymentCapital}</td>
                                <td>${it?.shouldRepaymentInterest}</td>
                                <td>
                                    <g:formatDate date="${it?.practicalChargeBackDate}"
                                                  format="yyyy-MM-dd"></g:formatDate>
                                </td>
                                <td>${it?.practicalRepaymentAmount}</td>
                                <td>${it?.practicalRepaymentCapital}</td>
                                <td>${it?.practicalRepaymentInterest}</td>
                                <td>${it?.practicalRepaymentFine}</td>
                                <td>
                                    <g:formatDate date="${it?.overdueDate}"
                                                  format="yyyy-MM"></g:formatDate>
                                    </td>
                                <td>${it?.overdueState?.name}</td>
                                <td>${it?.continuousOverdueNumber}</td>
                                <td>${it?.fineAmount}</td>
                                <td>${it?.prepaymentType?.name}</td>
                                <td>${it?.beforePrepaymentDuration}</td>
                                <td>${it?.afterPrepaymentDuration}</td>
                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="panel-footer">
                <div class="pagination">
                    <g:paginate total="${repaymentImportCount ?: 0}" params="${params}"/>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade hmodal-warning" id="myModal7" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog">
            <g:form controller="estateImport" action="excelImport" method="post" enctype="multipart/form-data">
                <div class="modal-content">
                    <div class="modal-body dataModal">
                        <div class="form-group">
                            <label class="col-md-3 control-label lineLab">批次名</label>

                            <div class="col-md-9"><input type="text" id="batch" name="batch" placeholder="请输入批次名"
                                                         class="form-control"></div>
                        </div>

                        <div class="form-group col-md-12">
                            <label class="col-md-3 control-label lineLab">处理状态</label>

                            <div class="col-md-9">
                                <select class="form-control m-b" name="status" id="status">
                                    <option>请选择处理状态</option>
                                    <option>等待处理</option>
                                    <option>处理完成</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group col-md-9 col-md-offset-3">
                            <a href='javascript:void(0);' class="blueButton">选择文件</a>
                            <input type="file" name="myFile" id="myFile" class="myFileUpload"/>
                        </div>
                    </div>

                    <div class="modal-footer">
                        <a href="download/templet.xls" style="font-weight:bold;text-decoration:none;color:#fff;" download>
                            <button type="button" class="btn btn-default">
                                导入模板下载
                            </button>
                        </a>
                        <button class="btn btn-default dataImport">
                            <input type="submit" value="导入">
                        </button>
                        <button class=" btn cancel" tabindex="2" style="display: inline-block; box-shadow: none;"
                                data-dismiss="modal">关闭</button>
                    </div>
                </div>
            </g:form>
        </div>
    </div>
</div>
<g:javascript>
    $(function () {
        //重置按钮
        $("#resetBtn").click(function () {
            $("#serialNumber").val("");
            $("#s2id_repaymentType span:first").html("请选择");
            $("#repaymentType").val("");
        })
        //导入弹出
        /*$('table').find('tbody').find('tr').on('click', function() {
            window.location.href("sdfg.jsp")
        })*/
    })

    //日期控件调用
    /*$('#datepicker').datepicker({
        language: 'zh-CN'
    });*/
    //上传文件按钮
   /* $(".myFileUpload").change(function () {
        var arrs = $(this).val().split('\\');
        var filename = arrs[arrs.length - 1];
        $(".show").html(filename);
    });*/

</g:javascript>

</body>
</html>
